import { Component, Input, OnInit ,Output, EventEmitter } from '@angular/core';
import { I18nService } from '../../core/i18n/i18n.service';

@Component({
  selector: 'app-wallet-table',
  templateUrl: './table-basic.html',
  styleUrls: ['./table-basic.scss']
})

export class TableComponent implements OnInit {
  @Input()
  data: Array<any>;

  @Input()
  page: any;

  @Input()
  titleData: Array<any>;

  @Output()
  tabelEvent: EventEmitter<any> = new EventEmitter<any>();

  constructor(
    private i18nService:I18nService
  ) {
  }

  changeLang(lang: string) {
    this.i18nService.changeLang(lang);
  }

  ngOnInit() { };

  onClick(name,data){
    let obj:any= { data:data };
    Object.assign(obj, name);
    this.tabelEvent.emit(obj);
  };

  changePage(pageNo,pageData):void{
    pageData.pageNo = pageNo;
    this.tabelEvent.emit(pageData);
  };
};


interface BanksTable{
  amount:number,//转帐金额
  category:string,//转账类型 receive || send 
  coinName:string,//币名称
  confirmation:number,//确认数
  id:string,//转账编号
  internalTransfer:string,//平台内地址间转帐[ Y, N ]
  regDtm:string,//记录时间
  status:string,//转帐状态[ PENDING, APPROVAL, COMPLETED, FAILED, REJECTED, CANCELED ]
  txId?:string,//转帐编号(区块链)
  cz?:any
}
